package com.sun.tools.xjc.addons.android_plugin;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.sun.codemodel.JAnnotationUse;
import com.sun.codemodel.JAnnotationValue;
import com.sun.codemodel.JDefinedClass;
import com.sun.codemodel.JStringLiteral;

public class Utilities {
  private Utilities() {}
  
  public static <T> T getFieldValue(Object o, String fieldName) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
    Class<? extends Object> objectClass = o.getClass();
    Field valueField = objectClass.getDeclaredField(fieldName);
    valueField.setAccessible(true);
    @SuppressWarnings("unchecked")
    T value = (T)valueField.get(o);
    return value;
  }
  
}
